Optimal. Leaf size=115 \[ \frac {4 \sqrt {2} a^2 \tanh ^{-1}\left (\frac {\sqrt {c} \cos (e+f x)}{\sqrt {2} \sqrt {c-c \sin (e+f x)}}\right )}{\sqrt {c} f}-\frac {2 a^2 c \cos ^3(e+f x)}{3 f (c-c \sin (e+f x))^{3/2}}-\frac {4 a^2 \cos (e+f x)}{f \sqrt {c-c \sin (e+f x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.17, antiderivative size = 115, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {2815, 2758,
2728, 212} \begin {gather*} -\frac {2 a^2 c \cos ^3(e+f x)}{3 f (c-c \sin (e+f x))^{3/2}}-\frac {4 a^2 \cos (e+f x)}{f \sqrt {c-c \sin (e+f x)}}+\frac {4 \sqrt {2} a^2 \tanh ^{-1}\left (\frac {\sqrt {c} \cos (e+f x)}{\sqrt {2} \sqrt {c-c \sin (e+f x)}}\right )}{\sqrt {c} f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 2728
Rule 2758
Rule 2815
Rubi steps
\begin {align*} \int \frac {(a+a \sin (e+f x))^2}{\sqrt {c-c \sin (e+f x)}} \, dx &=\left (a^2 c^2\right ) \int \frac {\cos ^4(e+f x)}{(c-c \sin (e+f x))^{5/2}} \, dx\\ &=-\frac {2 a^2 c \cos ^3(e+f x)}{3 f (c-c \sin (e+f x))^{3/2}}+\left (2 a^2 c\right ) \int \frac {\cos ^2(e+f x)}{(c-c \sin (e+f x))^{3/2}} \, dx\\ &=-\frac {2 a^2 c \cos ^3(e+f x)}{3 f (c-c \sin (e+f x))^{3/2}}-\frac {4 a^2 \cos (e+f x)}{f \sqrt {c-c \sin (e+f x)}}+\left (4 a^2\right ) \int \frac {1}{\sqrt {c-c \sin (e+f x)}} \, dx\\ &=-\frac {2 a^2 c \cos ^3(e+f x)}{3 f (c-c \sin (e+f x))^{3/2}}-\frac {4 a^2 \cos (e+f x)}{f \sqrt {c-c \sin (e+f x)}}-\frac {\left (8 a^2\right ) \text {Subst}\left (\int \frac {1}{2 c-x^2} \, dx,x,-\frac {c \cos (e+f x)}{\sqrt {c-c \sin (e+f x)}}\right )}{f}\\ &=\frac {4 \sqrt {2} a^2 \tanh ^{-1}\left (\frac {\sqrt {c} \cos (e+f x)}{\sqrt {2} \sqrt {c-c \sin (e+f x)}}\right )}{\sqrt {c} f}-\frac {2 a^2 c \cos ^3(e+f x)}{3 f (c-c \sin (e+f x))^{3/2}}-\frac {4 a^2 \cos (e+f x)}{f \sqrt {c-c \sin (e+f x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.29, size = 130, normalized size = 1.13 \begin {gather*} -\frac {a^2 \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left ((24+24 i) \sqrt [4]{-1} \tan ^{-1}\left (\left (\frac {1}{2}+\frac {i}{2}\right ) \sqrt [4]{-1} \left (1+\tan \left (\frac {1}{4} (e+f x)\right )\right )\right )+15 \cos \left (\frac {1}{2} (e+f x)\right )-\cos \left (\frac {3}{2} (e+f x)\right )+15 \sin \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {3}{2} (e+f x)\right )\right )}{3 f \sqrt {c-c \sin (e+f x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 2.29, size = 112, normalized size = 0.97
method | result | size |
default | \(-\frac {2 \left (\sin \left (f x +e \right )-1\right ) \sqrt {c \left (1+\sin \left (f x +e \right )\right )}\, a^{2} \left (6 c^{\frac {3}{2}} \sqrt {2}\, \arctanh \left (\frac {\sqrt {c \left (1+\sin \left (f x +e \right )\right )}\, \sqrt {2}}{2 \sqrt {c}}\right )-\left (c \left (1+\sin \left (f x +e \right )\right )\right )^{\frac {3}{2}}-6 \sqrt {c \left (1+\sin \left (f x +e \right )\right )}\, c \right )}{3 c^{2} \cos \left (f x +e \right ) \sqrt {c -c \sin \left (f x +e \right )}\, f}\) | \(112\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 258 vs.
\(2 (106) = 212\).
time = 0.34, size = 258, normalized size = 2.24 \begin {gather*} \frac {2 \, {\left (\frac {3 \, \sqrt {2} {\left (a^{2} c \cos \left (f x + e\right ) - a^{2} c \sin \left (f x + e\right ) + a^{2} c\right )} \log \left (-\frac {\cos \left (f x + e\right )^{2} + {\left (\cos \left (f x + e\right ) - 2\right )} \sin \left (f x + e\right ) + \frac {2 \, \sqrt {2} \sqrt {-c \sin \left (f x + e\right ) + c} {\left (\cos \left (f x + e\right ) + \sin \left (f x + e\right ) + 1\right )}}{\sqrt {c}} + 3 \, \cos \left (f x + e\right ) + 2}{\cos \left (f x + e\right )^{2} + {\left (\cos \left (f x + e\right ) + 2\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 2}\right )}{\sqrt {c}} + {\left (a^{2} \cos \left (f x + e\right )^{2} - 7 \, a^{2} \cos \left (f x + e\right ) - 8 \, a^{2} - {\left (a^{2} \cos \left (f x + e\right ) + 8 \, a^{2}\right )} \sin \left (f x + e\right )\right )} \sqrt {-c \sin \left (f x + e\right ) + c}\right )}}{3 \, {\left (c f \cos \left (f x + e\right ) - c f \sin \left (f x + e\right ) + c f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{2} \left (\int \frac {2 \sin {\left (e + f x \right )}}{\sqrt {- c \sin {\left (e + f x \right )} + c}}\, dx + \int \frac {\sin ^{2}{\left (e + f x \right )}}{\sqrt {- c \sin {\left (e + f x \right )} + c}}\, dx + \int \frac {1}{\sqrt {- c \sin {\left (e + f x \right )} + c}}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 220 vs.
\(2 (106) = 212\).
time = 0.51, size = 220, normalized size = 1.91 \begin {gather*} \frac {2 \, {\left (\frac {3 \, \sqrt {2} a^{2} \log \left (-\frac {\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1}{\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1}\right )}{\sqrt {c} \mathrm {sgn}\left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )} - \frac {8 \, \sqrt {2} {\left (2 \, a^{2} \sqrt {c} - \frac {3 \, a^{2} \sqrt {c} {\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}}{\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1} + \frac {3 \, a^{2} \sqrt {c} {\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}^{2}}{{\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}^{2}}\right )}}{c {\left (\frac {\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1}{\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1} - 1\right )}^{3} \mathrm {sgn}\left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}\right )}}{3 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (a+a\,\sin \left (e+f\,x\right )\right )}^2}{\sqrt {c-c\,\sin \left (e+f\,x\right )}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________